<div class="complaint_details">
  <% if controller.controller_name=="complaints" and controller.action_name=="show" %>
    <div class="title">
      <span><%=complaint.title%></span></div>
    <div class="description">
      <span><%=complaint.description %></span>
    </div>
  <% else %>
    <div class="link_title">
      <span><%= link_to complaint.title, complaint_path(complaint)%></span></div>
    <div class="description">
      <span><%=truncate(complaint.description, :length=> 150, :omission=>"#{'...  '+link_to("more", complaint_path(complaint))}")%></span>
    </div>
  <% end %>
  <div class="meta_info">
    <span>
      posted_on: <b><%=complaint.created_at.strftime('%d %b %y')%></b>&nbsp;&nbsp;
      in category: <%=link_to complaint.category.title,category_complaints_path(complaint.category) %>
    </span>
  </div>
  <% unless complaint.companies.empty? %>
    <div class="companies">
      <span>Companies: </span>
      <% complaint.companies.each do |company|%>
        <%= link_to company.title, company_complaints_path(company) %> &nbsp;
      <% end %>
    </div>
  <% end %>

  <% unless complaint.companies.empty? %>
    <div class="tags">
      <span>Tags: </span>
      <% complaint.tags.each do |tag|%>
        <span class="tags_box">
          <%= link_to tag.title, tag_complaints_path(tag) %> 
        </span>
      <% end %>
    </div>
  <% end %>
  <div class="share">
    <span>Share: </span>
    <span>
      <a name="fb_share" type="icon_link" href="http://www.facebook.com/sharer.php">&nbsp;</a>
    </span>
    <script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
    <span style="position:relative;top:1px;right:9px;">
      <a href="http://www.twitter.com/gvaswani"><img src="http://twitter-badges.s3.amazonaws.com/t_mini-a.png" alt="Twitter"/></a>
    </span>
  </div>

</div>
